<!DOCTYPE html>
<html>
<head>
    <title>userinfo</title>
    <style>
        .list-body1 {
            width: 70rem;
            background-color: rgb(255, 255, 255);
        }

        .list-body1 .sub-header {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            padding: 0 2.4rem;
            height: 5rem;
            white-space: nowrap;
/*             border-left: 1px solid rgb(221, 221, 221);
            border-right: 1px solid rgb(221, 221, 221); */
            border-bottom: 0.1rem solid rgb(218, 219, 219);
        }

        .list-body1 .sub-header .sub-header-title {
            margin-right: 1.2rem;
            font-size: 1.5rem;
            font-weight: 600;
            color: #000;
        }
        ul {
            padding: 0;
            margin: 0;
        }

        li {
            list-style: none;
        }

        .article-list li {
            padding: 18px 24px 13px 24px;
            background: #fff;
            border-bottom: 1px solid #f4f4f4;
            border-left: 1px solid rgb(221, 221, 221);
            border-right: 1px solid rgb(221, 221, 221);
            position: relative;
            /* -webkit-box-shadow: 0 1px 2px 0 rgba(0, 0, 0); */
            /* box-shadow: 0 1px 2px 0 rgba(0, 0, 0); */
        }

        a {
            outline: none;
            text-decoration: none;
            color: rgba(0, 0, 0);
        }

        .article-list li h2 a:visited {
            color: #b8b8b8;
        }

        .article-list li h2 a:link {
            color: #3d3d3d;
        }

        .article-list li h2 a:hover {
            color: red;
            text-decoration: underline;
        }

        .article-list li h2 {
            margin: 0;
            font-size: 2rem;
            font-weight: 600;
        }

        .article-list li h2 a {
            max-width: 98%;
            display: block;
            color: black;
            line-height: 2.4rem;
            height: 2.4rem;
            text-overflow: ellipsis;
            overflow: hidden;
            white-space: nowrap;

        }

        .article-list li h2 a .recommend {
            display: inline-block;
            width: 24px;
            height: 23px;
            border-radius: 4px;
            border: 1px solid #ca0c16;
            font-size: 14px;
            box-sizing: border-box;
            text-align: center;
            font-weight: 500;
            line-height: 23px;
            margin-right: 4px;
            vertical-align: 1px;
            /* position: relative; */
        }

        .article-list li h2 a .recommend-text {
            color: #ca0c16;
            /* position:absolute;
            top: 0.3rem;
            left:0.3rem; */
        }

        .article-list .article .summary {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            /* display: -webkit-box;
    text-overflow:ellipsis;
    overflow:hidden;
    -webkit-line-clamp: 1;
    -webkit-box-orient:vertical; */
            margin: 0.8rem 0 0.4rem;
            color: #8a8a8a;
            font-size: 1.4rem;
            line-height: 2.4rem;
        }

        .article-list .article .user-bar {
            display: block;
            /* margin-block-start: 1em;
    margin-block-end: 1em;
    margin-inline-start: 0px;
    margin-inline-end: 0px; */
            height: 2.4rem;
            line-height: 2.4rem;
            margin: 0.5rem 0 0.5rem 0.5rem;
        }

        .article-list .article .user-bar dt {
            float: left;
            margin: 0 0.6rem 0 0;
        }

        .article-list .article .user-bar dt .user-img {
            position: relative;
            display: inline-block;
        }

        .article-list .article .user-bar dt img {
            display: block;
            width: 2.4rem;
            height: 2.4rem;
            border-radius: 50%;
            object-fit: cover;
            overflow: hidden;
        }

        .article-list .article .user-bar .user_name {
            margin: 0;
            float: left;
            font-size: 1.4rem;
            color: #8a8a8a;
            line-height: 2.4rem;
        }

        .article-list .article .user-bar .interactive dd {
            float: left;
        }

        .article-list .article .user-bar .interactive {
            float: right
        }

        .article-list .article .user-bar .interactive .click_heart a {
            padding: 0 0.3rem 0 0;
        }

        .article-list .article .user-bar .interactive .click_heart .text {
            /* display: flex;
            flex-direction:row;
            align-items: center;
            justify-content: center; */
            position: relative;
            padding: 0 1.375rem;
            /* height: 2.015rem;
            width: 1.818rem; */
            /* overflow:hidden */
        }

        .article-list .article .user-bar .interactive .click_heart i {
            position: absolute;
            font-size: 1.9rem;
            left: 0.3rem;
            top: -0.120rem;
        }

        .article-list .article .user-bar .interactive a:hover {
            color: rgb(87, 162, 216);
        }

        .article-list .article .user-bar .interactive .num {
            color: rgb(87, 162, 216);
            font-size: 1.3rem;
        }

        .article-list .article .user-bar .interactive .click_heart .num::after {
            font-size: 2rem;
            content: "|";
            padding: 0rem 0rem 0.2rem 0.6rem;
            color: rgb(170, 166, 166);
        }

        .article-list .article .user-bar .interactive .read_num a {
            padding: 0 0.3rem 0 0;
        }

        .article-list .article .user-bar .interactive .read_num .text {
            vertical-align: -0.03rem;
        }

        .article-list .article .user-bar .interactive .read_num text {
            font-size: 1.3rem;
            display: inline-block;
        }

        .article-list .article .user-bar .interactive .read_num .num::after {
            font-size: 2rem;
            content: "|";
            padding: 0rem 0rem 0.2rem 0.6rem;
            color: rgb(170, 166, 166);
        }

         .article-list .article .user-bar .interactive .comment_num text {
            vertical-align: -0.24rem;
            font-size: 1.9rem;
        }

        .article-list .article .user-bar .interactive text:hover {
            color: rgb(87, 162, 216);
        }
       .article-list .article-list .article.user-bar .interactive .collection-btn{
            height: 36px;
            width: 7.7rem;
            line-height: 3.1rem;
                padding-top: 2px;
        } 
        
    </style>
</head>

<body>
    <div class="list-body1">
        <div class="sub-header">
            <div class="sub-header-title">收藏</div>
        </div>
        <div class="sub-item">
<!-- 收藏模块 -->
<ul class="article-list" th:each="article : ${myArticles}">
        <li class="article">
            <div class="entry">
                <div class="content">
                    <h2 ><a th:href="@{'/user/article/detail/'+${article.articleId}}" target="_blank" class="title"><span
						class="recommend recommend-text" th:if="${article.recommend}==1">
							荐 </span><span th:text="${article?.title}">Qt实用技巧：使用OpenCV库操作摄像头拍照、调节参数</span></a>
				</h2>
                    <div th:text="${article?.abstracts}"  class="summary">
                        欢迎来到“Python进阶”专栏！来到这里的每一位同学，应该大致上学习了很多 Python
                        的基础知识，正在努力成长的过程中。在此期间，一定遇到了很多的困惑，对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python
                        这门编程语言，从2009年开始单一使用 python
                        应对所有的开发工作，直至今天。回顾自己的学习过程，也曾经遇到过无数的困难，也曾经迷茫过、困惑过。开办这个专栏，正是为了帮助像我当年一样困惑的 Python
                        初学者走出困境、快速成长。希望我的经验能真正帮到你 </div>
                    <dl class="user-bar">
								<span th:each="author : ${Author}"> <span
									th:if="${author.userId} == ${article.userId}"><dt>
											<a th:href="'/user/other/'+${author.username}" target="_blank" class="user_img"> <img
												th:src="@{${author.icon}}" src="/images/bajie-1.jpg"
												alt="silentwolfyh" title="silentwolfyh" class="user-icon"
												username="silentwolfyh">
											</a>
										</dt>
										<dd class="user_name" th:text="${author.username}">pig</dd></span>
								</span>
								<div class="interactive">
                            <span class="click_heart">
                                <a th:href="@{'/user/article/detail/'+${article.articleId}}">
                                    <span class="text">
                                        <i class="layui-icon layui-icon-praise"></i>
                                    </span>
                                    <span  th:text="${article?.likes}" class="num">666</span>
                                </a>
                            </span>
                            <span class="read_num">
                                <a th:href="@{'/user/article/detail/'+${article.articleId}}">
                                    <span class="text">
                                        <text class="iconfont icon-youlan"></text>
                                    </span>
                                     <span th:text="${article?.browse}" class="num">666</span>
                                </a>
                            </span>
                            <span class="comment_num">
                                <a th:href="@{'/user/article/detail/'+${article.articleId}}">
                                    <span class="text">
                                        <text class="iconfont icon-huifu"></text>
                                    </span>
                                    <span  th:text="${article?.commentNum}" class="num">666</span></a>
                            </span>
                            <span class="collection">
                                <button class="collection-btn layui-btn  layui-btn-danger layui-btn-radius" th:value="${article.articleId}" onclick="removeCollection(this.value)" style="margin-left: 14px;">已收藏</button>
                            </span>
                        </div>
                    </dl>
                </div>
            </div>
        </li>
    </ul>

        </div>
    </div>

</body>
<script type="text/javascript">
$(document).ready(function() {
	$(".user-icon").each(function() {
		var iconSrc=$(this).attr('src');
		if(iconSrc.indexOf("?") == -1){
			$(this).attr("src",iconSrc+"?timeStamp=("+new Date()+')');
			}
		});
}); 
function removeCollection(articleId){
	 var userId = $("#userId").val();
			if(!confirm("是否取消收藏？")){
				return;//选择取消直接返回
			}
	$.ajax({
		type : "GET",
		url : "/user/power/collect",
		data : {
			articleId : articleId,
			collectId : -1,
			userId:userId
		},
		dataType : "JSON",
		success : function(result) {
			if (result.status == 200) {
				$('#list-body').load('/user/list-body-sc');
				var collectNum=$('#userinfo-collectNum').text();
				if(collectNum!=0){$('#userinfo-collectNum').text(--collectNum)};
			}
		}
	});
}
</script>
</html>